{% extends 'base.html' %}
{% load i18n %}


{% block extra_head %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
  $(function(){
  
  $('#openid_login').hide();
  $('#use_local').hide();

//--------------------------------------------------
  $('#use_openid').click(function(){
  
          $(this).hide();
          $('#local_login').slideUp(function(){
                  $('#openid_login').slideDown(function(){
                          $('#use_local').show();
                  });
                  return false;
          });
  });

//--------------------------------------------------
  $('#use_local').click(function(){
  
          $(this).hide();
          $('#openid_login').slideUp(function(){
                  $('#local_login').slideDown(function(){
                          $('#use_openid').show();
                  });
                  return false;
          });
  });


 

  });//end document ready
</script>

{% endblock extra_head%}

{% block body %}
{% if not user.is_authenticated %}
<div class="login">
  <form action="{% url oidauth_signin %}" method="post">
    <input type="hidden" name="next" value="{{ next }}" />

    <fieldset>
      <legend>{% trans "Signin using your site account or your OpenID url" %}</legend>

      <div id="local_login">
	<div class="fieldWrapper">
          {{ form.username.errors }}
          {{ form.username.label_tag }}: {{ form.username }}
	</div>
	<div class="fieldWrapper">
          {{ form.password.errors }}
          {{ form.password.label_tag }}: {{ form.password }}
	</div>
      </div>

      <div id="openid_login">
        <div class="fieldWrapper">
          {{ form.openid_url.errors }}
          {{ form.openid_url.label_tag }}: {{ form.openid_url }}
	</div>
      </div>

      <div class="submit-row">
        <input type="submit" value="{% trans "Sign in" %}"> 
	<div id='use_openid'>or <a href="#">use</a> your OpenID account</div>
	<div id='use_local'> or <a href="#">use</a> your site account </div>
      </div>
    </fieldset> 
  </form>
</div>
{% endif %}

{% endblock body%}
